/*
 * shape.h
 *
 *  Created on: Jul 4, 2008
 *      Author: Carlos Oliveira
 */

#ifndef SHAPE_H_
#define SHAPE_H_

#include "drawPrimitives.h"

struct shape_;

typedef void (*ShapeDrawFunc)(struct shape_ *);
typedef void (*ShapeDeleteFunc)(void *);
typedef int (*ShapeNumPointsFunc)();

typedef struct shapeVTable_
{
	ShapeDrawFunc drawFunc;
	ShapeDeleteFunc deleteFunc;
	ShapeNumPointsFunc numPointsFunc;
} ShapeVTable;

typedef struct shape_
{
	ShapeVTable *vtable;
	GContext context;
} Shape;

Shape *shape_new(GContext context);
void shape_delete(Shape *shape);
void shape_draw(Shape *shape);
int shape_numDefiningPoints(Shape *shape);
GContext shape_getContext(Shape *shape);

#endif /* SHAPE_H_ */
